package optimizer;

public class Optimizer {
    // 优化器的入口
    public static Optimizer instance;

    private Optimizer() {
    }

    public static Optimizer getInstance() {
        if (instance == null) {
            instance = new Optimizer();
        }
        return instance;
    }

    public void start() {
        ArithmeticOptimizer.optimize();
        OtherOptimizer.optimize();
    }

    public void openAll() {
        ConstantFolding.OPEN = true;
        ArithmeticOptimizer.OPEN = true;
        OtherOptimizer.OPEN = true;
    }
}
